<?php
/**
 * Created by PhpStorm.
 * User: chniccs
 * Date: 2019-11-09
 * Time: 16:17
 */

namespace app\model;

/**用户分销佣金比例表
 * Class AdminDistribution
 */
class AdminDistrimoney extends Base
{
    public static function doSave($data)
    {
        $model = self::get($data['tid']);
        if ($model) {
            $findData = $model->getData();
            $data['id'] = $findData['id'];
            $affected = $model->save($data);
            if ($affected) {
                return true;
            } else {
                return false;
            }
        }else{
            $done = self::create($data);
            return $done ? true : false;
        }
    }

}